CREATE TRIGGER trigger_Feldolgoz_torol
 ON Feldolgoz
     
   instead of Delete
     AS --declare @v Int
     BEGIN  
    	Delete From Feldolgoz
    	where  deleted.AtrakoAllomasId =  AtrakoAllomasId
        
        Delete From Szallit
        where  deleted.AtrakoAllomasId =  AtrakoAllomasId
        
		Delete From HulladekAtrakoAllomasEllenorzese
		where  deleted.AtrakoAllomasId =  AtrakoAllomasId
end


--set @v = (Select AtrakoAllomasId 
	--from AtrakoAllomas h,Feldolgoz f
	--where h.AtrakoallomasId = f.AtrakoallomasId and h.HulladekLerakoId =  )